
/**
 * @desc 生成指定位数的随机数
 * @param  {Number} num  
 * @return {Number} 
 */
function randomStr(num) {
    let $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
    let maxPo = $chars.length;
    let randomNum = '';
    for (let i = 0; i < num; i++) {
        randomNum += $chars.charAt(Math.floor(Math.random() * maxPo));
    }

    return randomNum;
}

export { randomStr };